define(function(require, exports, module) {

    exports.run = function() {

        var step = 10;

        $('#questions-show-board').find('.question-step:gt(9)').hide();

        $('#show-more-btn').on('click', function(){
            step += 10;
            $('#questions-show-board').find('.question-step:lt('+step+')').show();
        });

        $('#import-btn').on('click', function(){
            $('#import-btn').attr('disabled','disabled').button('reading');

            var questions = $('#questions').text();

            $.post($(this).data('url'), {questions:questions}, function(response){
                if (response > 0) {
                    $('#question-import-form').show();
                    var message = '成功导入' + response + '道题';
                    $('#questions-show-board').addClass('well text-success').html(message);
                    $('#question-import-btn').removeClass('disabled').button('reset');

                } else {
                    $('#import-btn').button('error');
                }
            });
        });
    };

});